<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel="stylesheet" href="style.css" type="text/css">
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
<link rel="Start" href="index.html">
<link rel="next" href="Genotype.html">
<link rel="Up" href="index.html">
<link title="Index of types" rel=Appendix href="index_types.html">
<link title="Index of exceptions" rel=Appendix href="index_exceptions.html">
<link title="Index of values" rel=Appendix href="index_values.html">
<link title="Index of modules" rel=Appendix href="index_modules.html">
<link title="DistMat" rel="Chapter" href="DistMat.html">
<link title="Genotype" rel="Chapter" href="Genotype.html">
<link title="Genotypes" rel="Chapter" href="Genotypes.html">
<link title="GenoMat" rel="Chapter" href="GenoMat.html">
<link title="DynMat" rel="Chapter" href="DynMat.html">
<link title="Dendogram" rel="Chapter" href="Dendogram.html">
<link title="Tree" rel="Chapter" href="Tree.html">
<link title="Clustering" rel="Chapter" href="Clustering.html">
<link title="BarnesHut" rel="Chapter" href="BarnesHut.html"><title>DistMat</title>
</head>
<body>
<div class="navbar">&nbsp;<a href="index.html">Up</a>
&nbsp;<a href="Genotype.html">Next</a>
</div>
<center><h1>Module <a href="type_DistMat.html">DistMat</a></h1></center>
<br>
<pre><span class="keyword">module</span> DistMat: <code class="code">sig</code> <a href="DistMat.html">..</a> <code class="code">end</code></pre>Distance matrices<br>
<hr width="100%">
<br>
This module allows us to manipulate distance matrices.<br>
<br>
The genetic distance is the number of different markers.
    In a distance matrix m, <code class="code">get m i j</code> is the distance between
    genotypes of index i and j.
<p>

   <b>Example :</b>
<p>

   g0, g1, g2 are 3 genotypes :<ul>
<li>g0 = 0 0 1 2</li>
<li>g1 = 0 0 1 3</li>
<li>g2 = 1 0 1 2</li>
</ul>

   Their distance is given by the distance function <code class="code">Genotype.diff</code> :<ul>
<li>diff(g0,g1) = 1</li>
<li>diff(g0,g2) = 1</li>
<li>diff(g1,g2) = 2</li>
</ul>

   The distance matrix is :
   <code class="code">[|
     [||];
     [|1|];
     [|1;2|]
   |]</code><br>
<pre><span class="keyword">exception</span> <a name="EXCEPTIONOut_of_range"></a>Out_of_range</pre>
<div class="info">
This exception is raised when one calls <code class="code">get m i j</code> where <code class="code">i = j</code><br>
</div>
<pre><span class="keyword">type</span> <a name="TYPEt"></a><code class="type">'a</code> t = <code class="type">'a array array</code> </pre>

<pre><span class="keyword">val</span> <a name="VALmk_dist"></a>mk_dist : <code class="type">('a -> 'a -> 'b) -> 'a array -> 'b array array</code></pre><pre><span class="keyword">val</span> <a name="VALcreate"></a>create : <code class="type">int -> 'a -> 'a array array</code></pre><pre><span class="keyword">val</span> <a name="VALinit"></a>init : <code class="type">int -> (int -> int -> 'a) -> 'a array array</code></pre><pre><span class="keyword">val</span> <a name="VALiter"></a>iter : <code class="type">('a -> unit) -> 'a array array -> unit</code></pre><pre><span class="keyword">val</span> <a name="VALiterij"></a>iterij : <code class="type">(int -> int -> 'a -> unit) -> 'a array array -> unit</code></pre><pre><span class="keyword">val</span> <a name="VALmap"></a>map : <code class="type">('a -> 'b) -> 'a array array -> 'b array array</code></pre><pre><span class="keyword">val</span> <a name="VALmodif"></a>modif : <code class="type">('a -> 'a) -> 'a array array -> unit</code></pre><pre><span class="keyword">val</span> <a name="VALmapij"></a>mapij : <code class="type">(int -> int -> 'a -> 'b) -> 'a array array -> 'b array array</code></pre><pre><span class="keyword">val</span> <a name="VALmodifij"></a>modifij : <code class="type">(int -> int -> 'a -> 'a) -> 'a array array -> unit</code></pre><pre><span class="keyword">val</span> <a name="VALfold_left"></a>fold_left : <code class="type">('a -> 'b -> 'a) -> 'a -> 'b array array -> 'a</code></pre><pre><span class="keyword">val</span> <a name="VALfold_right"></a>fold_right : <code class="type">('a -> 'b -> 'b) -> 'a array array -> 'b -> 'b</code></pre><pre><span class="keyword">val</span> <a name="VALget"></a>get : <code class="type">'a <a href="DistMat.html#TYPEt">t</a> -> int -> int -> 'a</code></pre><pre><span class="keyword">val</span> <a name="VALunsafe_get"></a>unsafe_get : <code class="type">'a <a href="DistMat.html#TYPEt">t</a> -> int -> int -> 'a</code></pre><pre><span class="keyword">val</span> <a name="VALset"></a>set : <code class="type">'a <a href="DistMat.html#TYPEt">t</a> -> int -> int -> 'a -> unit</code></pre><pre><span class="keyword">val</span> <a name="VALmax"></a>max : <code class="type">'a array array -> 'a</code></pre></body></html>